<template>
  <div class="wrap">
    <Navbar appTitle="退回" />
    <div class="wrap">
      <div>
        <van-cell-group style="margin-top: 0.1rem">
          <p class="label required FormTit"><span></span>退回原因</p>
          <van-field
            style="padding: 0 0.16rem 0.1rem !important"
            v-model="formData.returnReason"
            placeholder="请输入"
            maxlength="500"
          />
        </van-cell-group>
      </div>
    </div>

    <div class="subimtForm">
      <van-button
        class="button"
        :loading="loading"
        type="info"
        @click="subimtForm"
        >提交</van-button
      >
    </div>
  </div>
</template>

<script>
import Navbar from "@/components/navBar/navBar_right";
import { sendback } from "@/api/system";
export default {
  name: "proOrderDetail",
  components: { Navbar },
  data() {
    return {
      formData: {},
      loading: false,
    };
  },
  computed: {},
  mounted() {},
  created() {},
  methods: {
    subimtForm() {
      this.loading = true;
      if (this.formData.returnReason) {
        this.formData.repairId = this.$route.query.id;
        sendback(this.formData).then((res) => {
          if (res.code == 200) {
            this.loading = false;
            this.$toast(res.message);
            this.$router.go(-1);
          } else {
            this.loading = false;
            this.$toast(res.message);
          }
        });
      } else {
        this.loading = false;
      }
    },
  },
};
</script>
<style lang="scss" scoped>
@import "@/assets/detail.scss";
.subimtForm {
  height: 0.6rem;
  line-height: 0.5rem;
  width: 100%;
  background: #fff;
  position: fixed;
  bottom: 0px;
  .button {
    width: 94vw;
    height: 0.39rem;
    text-align: center;
    margin-left: 3vw;
  }
}
</style>